package com.weather.ui.mvp;

import com.weather.net.NetRespone;

import java.util.Map;

/**
 * Created by sunshine on 2017/3/7.
 */

public class PresenterImp implements Constant.Presenter {
    Constant.Model model;
    Constant.View view;

    public PresenterImp(Constant.View view) {
        model = new ModelImp();
        this.view = view;
    }

    @Override
    public void getMinuteNew(Map<String, String> map) {
        model.getMinuteNew(map, new NetRespone() {
            @Override
            public void success(Object result) {
                view.showMinuteNew(result);
            }

            @Override
            public void failed() {

            }
        });
    }

    @Override
    public void getAppIndexAll() {
        model.getAppIndexAll(new NetRespone() {
            @Override
            public void success(Object object) {
                view.showAppIndexAll(object);
            }

            @Override
            public void failed() {

            }
        });
    }

    @Override
    public void getAccurealFeel() {
        model.getAccurealFeel(new NetRespone() {
            @Override
            public void success(Object object) {
                view.showAccurealFeel(object);
            }

            @Override
            public void failed() {

            }
        });
    }

    @Override
    public void getYinpin() {
        model.getYinpin(new NetRespone() {
            @Override
            public void success(Object object) {
                view.showYinpin(object);
            }

            @Override
            public void failed() {

            }
        });
    }

    @Override
    public void getKeywordNew() {
        model.getKeywordNew(new NetRespone() {
            @Override
            public void success(Object object) {
                view.showKeywordNew(object);
            }

            @Override
            public void failed() {

            }
        });
    }

    @Override
    public void downYinpin(String url) {
        model.downYinpin(url, new NetRespone() {
            @Override
            public void success(Object object) {
                view.setIsReady((Boolean) object);
            }

            @Override
            public void failed() {

            }
        });
    }
}
